<?php
class Group extends AppModel {
/**
 * Model name
 *
 * @var string
 * @access public
 */
	public  $name = 'Group';
/**
 * Use Acl behavouir 
 *
 * @var array
 * @access public
 */
	public $actsAs = array('Acl' => 'requester');
/**
 * Field Validate
 * 
 * @var string
 * @access public
 *
 */
	public  $validate = array(
		'name' => array('notempty')
	);
/**
 * The Associations below have been created with all possible keys, 
 * those that are not needed can be removed
 *
 * @var array
 */
	public  $hasMany = array(
		'User' => array(
			'className' => 'User',
			'foreignKey' => 'group_id',
			'dependent' => false
		)
	);

	public function parentNode() {
        return null;
    }
    
 /**
  * Get group id by group name
  * 
  */
    
    public function getGroupId($group_name){
    	$group = $this->find('first',array('conditions' => array('Group.name'=>$group_name),'recursive' => -1));
    	return $group['Group']['id'];
    }
}
?>